From e95e10b4ea923cd71825742236aee2e505f2eb5b Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 6 Apr 2006 20:46:12 +0000 Subject: [PATCH] Pick up some stray feet/meter conversion. Regenerate dusky since it's provably correct. --- gpsbabel/bcr.c | 2 +- gpsbabel/csv_util.c | 2 +- gpsbabel/reference/dusky.gnuplot | 126 +++++++++++++++---------------- gpsbabel/tpg.c | 2 +- gpsbabel/tpo.c | 4 +- 5 files changed, 68 insertions(+), 68 deletions(-) diff --git a/gpsbabel/bcr.c b/gpsbabel/bcr.c index c64104a75..b1a9c8dd5 100644 --- a/gpsbabel/bcr.c +++ b/gpsbabel/bcr.c @@ -179,7 +179,7 @@ bcr_data_read(void) xalt = atof(cx); if (xalt != 999999999) { - wpt->altitude = xalt / 3.2808; /* convert feet to meters */ + wpt->altitude = FEET_TO_METERS(xalt); } if (case_ignore_strcmp(str, "Standort") == 0) diff --git a/gpsbabel/csv_util.c b/gpsbabel/csv_util.c index 8e0544849..9a5a78d75 100644 --- a/gpsbabel/csv_util.c +++ b/gpsbabel/csv_util.c @@ -1274,7 +1274,7 @@ xcsv_waypt_pr(const waypoint *wpt) if (strcmp(fmp->key, "ALT_FEET") == 0) { /* altitude in feet as a decimal value */ writebuff(buff, fmp->printfc, - (wpt->altitude * 3.2808)); + METERS_TO_FEET(wpt->altitude)); } else if (strcmp(fmp->key, "ALT_METERS") == 0) { /* altitude in meters as a decimal value */ diff --git a/gpsbabel/reference/dusky.gnuplot b/gpsbabel/reference/dusky.gnuplot index 87fe2c4ba..952cfebe1 100644 --- a/gpsbabel/reference/dusky.gnuplot +++ b/gpsbabel/reference/dusky.gnuplot @@ -1,65 +1,65 @@ plot "-" with lines -0.0000 623.352000 -2.9718 711.933600 -3.2850 715.214400 -3.6167 715.214400 -5.5243 705.372000 -9.4129 659.440800 -23.4703 606.948000 -25.0162 610.228800 -30.9820 623.352000 -32.4677 616.790400 -34.3415 629.913600 -39.1519 639.756000 -40.1487 643.036800 -43.8551 639.756000 -45.1980 639.756000 -50.2415 643.036800 -50.7511 613.509600 -52.4188 652.879200 -59.6859 662.721600 -61.2516 698.810400 -71.6546 738.180000 -72.5283 764.426400 -87.9457 721.776000 -88.7923 725.056800 -91.6167 764.426400 -99.6578 902.220000 -99.8003 905.500800 -99.9720 905.500800 -100.1892 902.220000 -100.5724 882.535200 -102.0104 882.535200 -102.8041 875.973600 -103.0804 872.692800 -107.3975 921.904800 -107.9219 915.343200 -111.8075 977.678400 -112.3607 974.397600 -113.7989 1003.924800 -115.6245 967.836000 -119.3377 1082.664000 -120.3016 1040.013600 -122.6318 1030.171200 -125.0204 1056.417600 -125.1988 1089.225600 -127.7871 1076.102400 -129.8891 997.363200 -130.3262 974.397600 -130.9400 971.116800 -131.4143 1020.328800 -142.6996 935.028000 -147.6842 905.500800 -154.3627 902.220000 -155.0489 889.096800 -155.6592 872.692800 -156.1879 846.446400 -156.8340 869.412000 -157.3818 875.973600 -159.8910 846.446400 -159.9999 856.288800 -163.1963 866.131200 -164.7320 869.412000 -164.9323 859.569600 -165.1204 849.727200 +0.0000 623.359581 +2.9718 711.942258 +3.2850 715.223098 +3.6167 715.223098 +5.5243 705.380579 +9.4129 659.448820 +23.4703 606.955382 +25.0162 610.236221 +30.9820 623.359581 +32.4677 616.797901 +34.3415 629.921261 +39.1519 639.763781 +40.1487 643.044620 +43.8551 639.763781 +45.1980 639.763781 +50.2415 643.044620 +50.7511 613.517061 +52.4188 652.887140 +59.6859 662.729660 +61.2516 698.818899 +71.6546 738.188978 +72.5283 764.435697 +87.9457 721.784778 +88.7923 725.065618 +91.6167 764.435697 +99.6578 902.230973 +99.8003 905.511812 +99.9720 905.511812 +100.1892 902.230973 +100.5724 882.545933 +102.0104 882.545933 +102.8041 875.984253 +103.0804 872.703413 +107.3975 921.916012 +107.9219 915.354332 +111.8075 977.690290 +112.3607 974.409450 +113.7989 1003.937009 +115.6245 967.847771 +119.3377 1082.677167 +120.3016 1040.026248 +122.6318 1030.183729 +125.0204 1056.430448 +125.1988 1089.238847 +127.7871 1076.115487 +129.8891 997.375330 +130.3262 974.409450 +130.9400 971.128610 +131.4143 1020.341209 +142.6996 935.039372 +147.6842 905.511812 +154.3627 902.230973 +155.0489 889.107613 +155.6592 872.703413 +156.1879 846.456694 +156.8340 869.422573 +157.3818 875.984253 +159.8910 846.456694 +159.9999 856.299214 +163.1963 866.141734 +164.7320 869.422573 +164.9323 859.580054 +165.1204 849.737534 e diff --git a/gpsbabel/tpg.c b/gpsbabel/tpg.c index 992866e8f..e2d4b10c1 100644 --- a/gpsbabel/tpg.c +++ b/gpsbabel/tpg.c @@ -281,7 +281,7 @@ tpg_waypt_pr(const waypoint *wpt) lon *= -1.0; /* convert meters back to feets */ - elev = (short int) (wpt->altitude * 3.2808); + elev = (short int) METERS_TO_FEET(wpt->altitude); /* 1 bytes stringsize for shortname */ c = strlen(shortname); diff --git a/gpsbabel/tpo.c b/gpsbabel/tpo.c index b68b321ab..838f09adc 100644 --- a/gpsbabel/tpo.c +++ b/gpsbabel/tpo.c @@ -759,10 +759,10 @@ tpo_track_disp(const waypoint *waypointp) &z); /* increase the track length by the 3D length of last track segment in feet */ - track_length += 3.2808 * sqrt( + track_length += METERS_TO_FEET(sqrt( (x - last_waypoint_x) * (x - last_waypoint_x) + (y - last_waypoint_y) * (y - last_waypoint_y) + - (z - last_waypoint_z) * (z - last_waypoint_z)); + (z - last_waypoint_z) * (z - last_waypoint_z))); last_waypoint_x = x; last_waypoint_y = y; last_waypoint_z = z; -- 2.30.2